package kitty.main;

import android.graphics.BitmapFactory;

import com.example.kittyvszombie.R;

public class CuteKitty extends Kitty {

	public CuteKitty(MainView view, int row, float x, float y) {
		this.view = view;
		this.row = row;
		projectiles = view.getProjectiles();
		stars = view.getStars();
		damage = 4;
		this.x = x;
		this.y = y;


		kittyImage = BitmapFactory.decodeResource(view.getResources(),
				R.drawable.cutekitty1);
		attackImage = BitmapFactory.decodeResource(view.getResources(),
				R.drawable.cutekitty1);
		deadImage = BitmapFactory.decodeResource(view.getResources(),
				R.drawable.cutekitty_dead);
		projectileImage = BitmapFactory.decodeResource(view.getResources(),
				R.drawable.heart);
		rateOfFire = 20.0f;
		image = kittyImage;
	}

	@Override
	public void update() {
		
		checkEnemyOnRow();

		if (!dead && foundEnemies) {
			updateAttackTime();
			if (attackStart != 0
					&& System.currentTimeMillis() > attackStart + 1000) {
				attackStart = 0;
				image = kittyImage;
			}
			
			if (attack) {
				thowProjectile();
			}
		}
	}
}